//  这个不需要学习
class SimpleRandom {
    private:
        unsigned long seed;
        
    public:
        SimpleRandom(unsigned long initialSeed = 1) : seed(initialSeed) {}
        
        void setSeed(unsigned long newSeed) { seed = newSeed; }
        
        // Linear Congruential Generator (LCG)
        unsigned long next() {
            seed = (seed * 1103515245 + 12345) & 0x7FFFFFFF;
            return seed;
        }
        
        // Generate random number in range [0, max-1]
        unsigned long next(unsigned long max) {
            return next() % max;
        }
        
        // Generate random number in range [min, max]
        int next(int min, int max) {
            return min + static_cast<int>(next() % (max - min + 1));
        }
    };


